﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using XStudio.XCRF.Data.Business.Archieve;
using XStudio.XCRF.Data.Enums;

namespace XStudio.XCRF.Data.Entities.BasicInfo
{
    /// <summary>
    /// 基本信息
    /// </summary>
    public partial class BasicInfo : BaseEntity<BasicInfo>, IArchieve
    {
        #region 属性
        /// <summary>
        /// CRF主表记录ID
        /// </summary>
        [ForeignKey("CRF")]
        public Guid? CRFID { get; set; }
        /// <summary>
        /// CRF主表记录
        /// </summary>
        public CRF CRF { get; set; }
        /// <summary>
        /// 签署知情同意书日期
        /// </summary>
        [ArchieveField]
        [DataType(DataType.Date)]
        [Column(TypeName = "date")]
        public DateTime? AgreeTime { get; set; }

        /// <summary>
        /// 就诊科室
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string Office { get; set; }
        /// <summary>
        /// 药物编号
        /// </summary>
        [ArchieveField]
        public string MedicineCode { get; set; }
        /// <summary>
        /// 身高
        /// </summary>
        [ArchieveField]
        public decimal Height { get; set; }
        /// <summary>
        /// 体重
        /// </summary>
        [ArchieveField]
        public decimal Weight { get; set; }
        /// <summary>
        /// 病历来源类型
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(SourceTypes))]
        public byte Source { get; set; }
        /// <summary>
        /// 住院号
        /// </summary>
        [ArchieveField]
        public string AdmissionCode { get; set; }
        /// <summary>
        /// 病程 月
        /// </summary>
        [ArchieveField]
        public byte? Course { get; set; }
        /// <summary>
        /// 家族史
        /// </summary>
        [InverseProperty("BasicInfo")]
        public virtual ICollection<FamilyHistory> FamilyHistories { get; set; }
        /// <summary>
        /// 过敏史
        /// </summary>
        [InverseProperty("BasicInfo")]
        public virtual ICollection<AllergyHistory> AllergyHistories { get; set; }
        /// <summary>
        /// 西药诊断
        /// </summary>
        [ArchieveField]
        public string WestDiagnose { get; set; }
        /// <summary>
        /// 病理
        /// </summary>
        [ArchieveField]
        public string Pathology { get; set; }


        /***************************************/
        //添加

        /// <summary>
        /// 病例号
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string CaseCode { get; set; }

        /// <summary>
        /// 病理号
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string PathologyCode { get; set; }

        /// <summary>
        /// 手术医院
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string OperationHospital { get; set; }

        /// <summary>
        /// 手术时间
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "date")]
        public DateTime? OperationTime { get; set; }

        /// <summary>
        /// 肿瘤大小_长
        /// </summary>
        [ArchieveField]
        public float? TumorLength { get; set; }

        /// <summary>
        /// 肿瘤大小_宽
        /// </summary>
        [ArchieveField]
        public float? TumorWidth { get; set; }

        /// <summary>
        /// 肿瘤大小_高
        /// </summary>
        [ArchieveField]
        public float? TumorHeight { get; set; }

        /// <summary>
        /// 肿瘤部位
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(TumorPlaceTypes))]
        public byte TumorPlace { get; set; }

        /// <summary>
        /// 距肛门距离
        /// </summary>
        [ArchieveField]
        public float? Distance { get; set; }

        /// <summary>
        /// 肿瘤备注
        /// </summary>
        [ArchieveField]
        public string TumorRemark { get; set; }

        /// <summary>
        /// 病理学类型
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(PathologyTypes))]
        public byte PathologyType { get; set; }

        /// <summary>
        /// 浸润部位
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(InfiltrationPlaceTypes))]
        public byte InfiltrationPlace { get; set; }

        /// <summary>
        /// 分化
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(SplitTypes))]
        public byte Split { get; set; }

        /// <summary>
        /// 淋巴结转移
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(LymphMoveTypes))]
        public byte LymphMove { get; set; }

        /// <summary>
        /// 上切缘
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(TopCutEdgeTypes))]
        public byte TopCutEdge { get; set; }

        /// <summary>
        /// 下切缘
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(BottomCutEdgeTypes))]
        public byte BottomCutEdge { get; set; }

        /// <summary>
        /// 脉管内癌栓
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(PulseEmbolusTypes))]
        public byte PulseEmbolus { get; set; }
        /***************************************/

        /// <summary>
        /// KPS评分
        /// </summary>
        [ArchieveField]
        public byte? KPS { get; set; }
        /// <summary>
        /// ECOG评分
        /// </summary>
        [ArchieveField]
        public byte? ECOG { get; set; }
        /// <summary>
        /// TNM分期
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        public string TNM { get; set; }
        /// <summary>
        /// Dukes分期
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        public string Dukes { get; set; }
        /// <summary>
        /// 化疗信息
        /// </summary>
        [InverseProperty("BasicInfo")]
        public virtual ICollection<BasicChemo> Chemos { get; set; }
        /// <summary>
        /// 放疗信息
        /// </summary>
        [InverseProperty("BasicInfo")]
        public virtual ICollection<BasicRadio> Radios { get; set; }
        /// <summary>
        /// 其他治疗信息
        /// </summary>
        [InverseProperty("BasicInfo")]
        public virtual ICollection<BasicOtherCure> OtherCures { get; set; }
        /// <summary>
        /// 合并其它疾病及用药
        /// </summary>
        public virtual ICollection<BasicOtherMerge> OtherMerges { get; set; }
        /// <summary>
        /// 体温℃
        /// </summary>
        [ArchieveField]
        public decimal? Temperature { get; set; }
        /// <summary>
        /// 心率 次/分
        /// </summary>
        [ArchieveField]
        public byte? HeartRate { get; set; }
        /// <summary>
        /// 呼吸 次/分
        /// </summary>
        [ArchieveField]
        public byte? Breath { get; set; }
        /// <summary>
        /// 最高血压 mmHg
        /// </summary>
        [ArchieveField]
        public byte? MaxBP { get; set; }
        /// <summary>
        /// 最低血压 mmHg
        /// </summary>
        [ArchieveField]
        public byte? MinBP { get; set; }

        /// <summary>
        /// 确诊时间
        /// </summary>
        [ArchieveField]
        [DataType(DataType.Date)]
        [Column(TypeName = "date")]
        public DateTime? DiaTime { get; set; }
        /// <summary>
        /// 手术次数及方式
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        public string Oper { get; set; }
        /// <summary>
        /// 腹水
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(YouWuTypes))]
        public byte fs { get; set; }
        /// <summary>
        /// 胸水
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(YouWuTypes))]
        public byte xs { get; set; }
        /// <summary>
        /// 复发转移情况
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(YouWuTypes))]
        public byte ffzyqk { get; set; }
        /// <summary>
        /// 复发转移部位
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string ffzybw { get; set; }
        /// <summary>
        /// 发现转移时间
        /// </summary>
        [ArchieveField]
        [DataType(DataType.Date)]
        [Column(TypeName = "date")]
        public DateTime? fxzysj { get; set; }
        /// <summary>
        /// 转移途径
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        public string zytj { get; set; }
        /// <summary>
        /// 死亡否
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(YouWuTypes))]
        public byte swf { get; set; }
        /// <summary>
        /// 无进展生存时间
        /// </summary>
        [ArchieveField]
        [DataType(DataType.Date)]
        [Column(TypeName = "date")]
        public DateTime? wjzscsj { get; set; }
        /// <summary>
        /// 死亡原因
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        public string swyy { get; set; }
        #endregion 属性
    }
}
